
clear all

cd "$root"
use "Data/data_voter.dta"
cd "$output"

global FE "OperatorId t_block"

* Create weighting variables used in secondary specifications *
cap drop wgt_obs wgt_reg
gen wgt_obs = 1/obs
gen wgt_reg = reg/obs

*** Descriptive statistics *****************************************************
********************************************************************************

estpost summarize ED_week ED_n_debates ED_n_cand_17 ED_incum_run ED_ran_11 ED_log_reg_17 /// 
	ED_vote_1_11 ED_vote_2_11 ED_vote_3_11 ED_hhi_11 ED_turnout ED_pop_dens_08 ED_age_18 ED_ed_sec /// 
	ED_gsm_15 ED_own_radio ED_radio_news ED_radio_cov if seq == 1, listwise
est store A
estpost summarize r_male r_age r_ed_1 r_ed_2 r_ed_3, listwise
est store B

*** Descriptive statistics ***
esttab A using "Table A1.tex", replace ///
	nonum cells("mean(fmt(2) label({Mean})) sd(fmt(2) label({SD})) min(fmt(2) label({Min})) max(fmt(2) label({Max}))") ///
	label nomtitles refcat(ED_week "\textbf{A. District-level variables} (\textit{n} = 73)", nolabel) b(3) se f nogaps booktabs sfmt(3 0) noobs compress
esttab B using "Table A1.tex", append ///
	nonum cells("mean(fmt(2) label($ $)) sd(fmt(2) label($ $)) min(fmt(2) label($ $)) max(fmt(2) label($ $))") ///
	label nomtitles refcat(r_male "\textbf{B. Individual-level variables} (\textit{n} = 4060)", nolabel) b(3) se f nogaps booktabs sfmt(3 0) noobs compress
	
estpost summarize deb_attend_share deb_attend_incumbent deb_attend_chal, listwise
est store A

estpost summarize d_heard_d d_heard d_heard_N d_winner_attend d_share_participants d_share_top3 i_CDF_correct_d i_CDF_rep_law_d i_CDF_cit_law_d i_radio_d i_other_sources i_friends_d , listwise
est store B

*** Descriptive statistics (respondent level outcomes) ***
esttab A using "Table A2.tex", replace ///
	nonum cells("mean(fmt(2) label({Mean})) sd(fmt(2) label({SD})) min(fmt(2) label({Min})) max(fmt(2) label({Max}))") /// 
	label nomtitles substitute(_ _) refcat(deb_attend_share "\textbf{Table 5}", nolabel) b(3) se f nogaps booktabs sfmt(3 0) noobs compress
esttab B using "Table A2.tex", append ///
	nonum cells("mean(fmt(2) label($ $)) sd(fmt(2) label($ $)) min(fmt(2) label($ $)) max(fmt(2) label($ $))") ///
	label nomtitles substitute(_ _) refcat(d_heard_d "\textbf{Table 8}", nolabel) b(3) se f nogaps booktabs sfmt(3 0) noobs compress

*** Balance tables  ************************************************************
********************************************************************************

foreach var in ED_week ED_vote_3_11 ED_vote_2_11 ED_vote_1_11 ED_turnout_11 ED_ran_11 ED_radio_news ED_radio_cov ED_pop_dens_08 ED_own_radio ED_n_debates ED_n_cand_17 ED_log_reg_17 ED_incum_run ED_hhi_11 ED_gsm_15 ED_ed_sec ED_age_18 r_survey_day r_age r_male r_education {
capture drop outcome
	* Individual-level estimation *
	eststo `var': cap qui areg `var' i.t_invite, absorb( t_block ) cluster(EDCODE)
		qui estadd local Weight "No"
		qui estadd local Controls "None"
		qui sum `var' if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
		qui estadd scalar Control_SD = `r(sd)'
	eststo `var'_w1: cap qui areg `var' i.t_invite [aw=wgt_obs], absorb( t_block ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"
		qui estadd local Controls "None"
		qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
		qui estadd scalar Control_SD = `r(sd)'
	eststo `var'_w2: cap qui areg `var' i.t_invite [aw=wgt_reg], absorb( t_block ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		qui estadd local Controls "None"
		qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
		qui estadd scalar Control_SD = `r(sd)'
	* District-level estimation *
	eststo `var'_2: cap qui areg `var' i.t_invite if seq == 1, absorb( t_block ) vce(robust)
		qui estadd local Weight "None"
		qui estadd local Controls "None"
		qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
		qui estadd scalar Control_SD = `r(sd)'
	eststo `var'_2_w1: cap qui areg `var' i.t_invite if seq == 1 [aw=reg], absorb( t_block ) vce(robust)
		qui estadd local Weight "Reg"
		qui estadd local Controls "None"
		qui sum `var' [aw=reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
		qui estadd scalar Control_SD = `r(sd)'
}

*** District-level balance ***
	
local lines "\cmidrule(lr{1em}){2-3} \cmidrule(lr{1em}){4-5} \cmidrule(lr{1em}){6-7} "	
local titles "& \multicolumn{2}{c}{ \textbf{VS of 1st place (2011)} } & \multicolumn{2}{c}{ \textbf{VS of 1st place (2011)} } & \multicolumn{2}{c}{ \textbf{VS of 3rd place (2011)} } \\"
esttab ED_vote_1_11_2 ED_vote_1_11_2_w1 ED_vote_2_11_2 ED_vote_2_11_2_w1 ED_vote_3_11_2 ED_vote_3_11_2_w1 using "Table A5.tex", ///
	replace nonumber nomtitles posthead("`titles'" "`lines'") nonumber b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress nobaselevels drop(_cons) star(* 0.10 ** 0.05 *** 0.01)
local titles "\midrule & \multicolumn{2}{c}{ \textbf{Turnout (2011)} } & \multicolumn{2}{c}{ \textbf{Share ran in 2011} } & \multicolumn{2}{c}{ \textbf{VS HHI (2011)} } \\"	
esttab ED_turnout_11_2 ED_turnout_11_2_w1 ED_ran_11_2 ED_ran_11_2_w1 ED_hhi_11_2 ED_hhi_11_2_w1  using "Table A5.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress nobaselevels drop(_cons) star(* 0.10 ** 0.05 *** 0.01)
local titles "\midrule & \multicolumn{2}{c}{ \textbf{N. candidates (2017)} } & \multicolumn{2}{c}{ \textbf{Incumbent ran (2017)} } & \multicolumn{2}{c}{ \textbf{Number of debates} } \\"		
esttab ED_n_cand_17_2 ED_n_cand_17_2_w1 ED_incum_run_2 ED_incum_run_2_w1 ED_n_debates_2 ED_n_debates_2_w1 using "Table A5.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress  nobaselevels star(* 0.10 ** 0.05 *** 0.01) drop(_cons)
local titles "\midrule & \multicolumn{2}{c}{ \textbf{Log pop. dens. (2008)} } & \multicolumn{2}{c}{ \textbf{Log reg. voters (2017)} } & \multicolumn{2}{c}{ \textbf{GSM coverage (2016)} } \\"			
esttab ED_pop_dens_08_2 ED_pop_dens_08_2_w1  ED_log_reg_17_2 ED_log_reg_17_2_w1 ED_gsm_15_2 ED_gsm_15_2_w1 using "Table A5.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress  nobaselevels star(* 0.10 ** 0.05 *** 0.01) drop(_cons)
local titles "\midrule & \multicolumn{2}{c}{ \textbf{Share owns radio (2015)} } & \multicolumn{2}{c}{ \textbf{Share radio news (2015)} } & \multicolumn{2}{c}{ \textbf{Radio coverage (2016)} } \\"				
esttab ED_own_radio_2 ED_own_radio_2_w1  ED_radio_news_2 ED_radio_news_2_w1 ED_radio_cov_2 ED_radio_cov_2_w1 using "Table A5.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{2}{c}{ \textbf{Debate week} } & \multicolumn{2}{c}{ \textbf{Share sec. ed. (2008)} } & \multicolumn{2}{c}{ \textbf{Share 18+ (2008)} } \\"				
esttab ED_week_2 ED_week_2_w1  ED_ed_sec_2 ED_ed_sec_2_w1 ED_age_18_2 ED_age_18_2_w1 using "Table A5.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  sfmt(3 %9.0fc 0) scalars("Control_Mean \hspace{0.1cm} Control Mean"  "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)	
	
*** Individual-level balance (District covariates) ***
local lines "\cmidrule(lr{1em}){2-4} \cmidrule(lr{1em}){5-7} \cmidrule(lr{1em}){8-10} "	
local titles "& \multicolumn{3}{c}{ \textbf{VS of 1st place (2011)} } & \multicolumn{3}{c}{ \textbf{VS of 1st place (2011)} } & \multicolumn{3}{c}{ \textbf{VS of 3rd place (2011)} } \\"
esttab ED_vote_1_11 ED_vote_1_11_w1 ED_vote_1_11_w2 ED_vote_2_11 ED_vote_2_11_w1 ED_vote_2_11_w2 ED_vote_3_11_2 ED_vote_3_11_w1 ED_vote_3_11_w2 using "Table A6.tex", ///
	replace nonumber nomtitles posthead("`titles'" "`lines'") nonumber b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{3}{c}{ \textbf{Turnout (2011)} } & \multicolumn{3}{c}{ \textbf{Share ran in 2011} } & \multicolumn{3}{c}{ \textbf{VS HHI (2011)} } \\"	
esttab ED_turnout_11 ED_turnout_11_w1 ED_turnout_11_w2 ED_ran_11 ED_ran_11_w1 ED_ran_11_w2 ED_hhi_11 ED_hhi_11_w1 ED_hhi_11_w2 using "Table A6.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{3}{c}{ \textbf{N. candidates (2017)} } & \multicolumn{3}{c}{ \textbf{Incumbent ran (2017)} } & \multicolumn{3}{c}{ \textbf{Number of debates} } \\"		
esttab ED_n_cand_17 ED_n_cand_17_w1 ED_n_cand_17_w2 ED_incum_run ED_incum_run_w1 ED_incum_run_w2 ED_n_debates ED_n_debates_w1 ED_n_debates_w2 using "Table A6.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{3}{c}{ \textbf{Log pop. dens. (2008)} } & \multicolumn{3}{c}{ \textbf{Log reg. voters (2017)} } & \multicolumn{3}{c}{ \textbf{GSM coverage (2016)} } \\"			
esttab ED_pop_dens_08 ED_pop_dens_08_w1 ED_pop_dens_08_w2  ED_log_reg_17 ED_log_reg_17_w1 ED_log_reg_17_w2 ED_gsm_15 ED_gsm_15_w1 ED_gsm_15_w2 using "Table A6.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{3}{c}{ \textbf{Share owns radio (2015)} } & \multicolumn{3}{c}{ \textbf{Share radio news (2015)} } & \multicolumn{3}{c}{ \textbf{Radio coverage (2016)} } \\"				
esttab ED_own_radio ED_own_radio_w1 ED_own_radio_w2  ED_radio_news ED_radio_news_w1 ED_radio_news_w2 ED_radio_cov ED_radio_cov_w1 ED_radio_cov_w2 using "Table A6.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule & \multicolumn{3}{c}{ \textbf{Debate week} } & \multicolumn{3}{c}{ \textbf{Share sec. ed. (2008)} } & \multicolumn{3}{c}{ \textbf{Share 18+ (2008)} } \\"				
esttab ED_week ED_week_w1 ED_week_w2  ED_ed_sec ED_ed_sec_w1 ED_ed_sec_w2 ED_age_18 ED_age_18_w1 ED_age_18_w2 using "Table A6.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  sfmt(3 %9.0fc 0) scalars("Control_Mean \hspace{0.1cm} Control Mean"  "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
	
*** Individual-level balance (Individual covariates) ***
local lines "\cmidrule(lr{1em}){2-4} \cmidrule(lr{1em}){5-7} "	
local titles "& \multicolumn{3}{c}{ \textbf{Survey date} } & \multicolumn{3}{c}{\textbf{Age}} \\"
esttab r_survey_day r_survey_day_w1 r_survey_day_w2 r_age r_age_w1 r_age_w2 using "Table A7.tex", ///
	replace nonumber nomtitles posthead("`titles'" "`lines'") nonumber b(3) se label alignment(S S S) f nomtitles nogaps booktabs  scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
local titles "\midrule  & \multicolumn{3}{c}{\textbf{Male}}  & \multicolumn{3}{c}{ \textbf{Education level} } \\"	
esttab r_male r_male_w1 r_male_w2 r_education r_education_w1 r_education_w2 using "Table A7.tex", ///
	append nonumber nomtitles posthead("`titles'" "`lines'") b(3) se label alignment(S S S) f nomtitles nogaps booktabs  sfmt(3 %9.0fc 0) scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels drop(_cons)
	
*** Effects on debate participation ********************************************
********************************************************************************

estimates drop _all
global ctrls "c.r_survey_day c.r_male c.r_age c.r_ed_* c.ED_*"
global ctrls_ed "c.ED_*"
global keep_vars "1.t_invite r_survey_day r_male r_age r_ed_* ED_*"

foreach var in rb_confirm rb_survey deb_attend_share deb_attend_chal deb_attend_incumbent deb_attend_nonchal deb_attend_chal_a deb_attend_nonchal_a deb_attend_winner {
	* Individual-level estimation *
	eststo `var': cap qui reghdfe `var' 1.t_invite $ctrls, absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "No"	
		quietly qui sum `var' if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_w1: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_obs], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"	
		quietly qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_w2: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_reg], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		quietly qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_w3: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_dem], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Dem"
		quietly qui sum `var' [aw=wgt_dem] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'		
	* District-level estimation *
	eststo `var'_2: cap qui areg `var' 1.t_invite $ctrls_ed if seq==1, absorb( t_block ) robust
		qui estadd local Weight "No"
		quietly qui sum `var' if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_2_w1: cap qui areg `var' 1.t_invite $ctrls_ed if seq==1 [aw=reg], absorb( t_block ) robust
		qui estadd local Weight "Reg"
		quietly qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'	
}

*** Effects on candidate debate participation ***
local numbers " & (1) & (2) & (3) \\ \midrule"	
esttab deb_attend_share deb_attend_share_w1 deb_attend_share_w2 using "Table 5.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Share of candidates}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_incumbent deb_attend_incumbent_w1 deb_attend_incumbent_w2 using "Table 5.tex", ///
	nonumber append refcat(1.t_invite "\textbf{B. Incumbent}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_chal deb_attend_chal_w1 deb_attend_chal_w2 using "Table 5.tex", ///
	nonumber append refcat(1.t_invite "\textbf{C. Share of challengers}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_nonchal deb_attend_nonchal_w1 deb_attend_nonchal_w2 using "Table 5.tex", ///
	nonumber append refcat(1.t_invite "\textbf{D. Share of other candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)

*** Effects on candidate debate participation (supplementary) ***
esttab deb_attend_winner deb_attend_winner_w1 deb_attend_winner_w2 using "Table A20.tex", ///
	nonumber replace posthead("`numbers'") refcat(1.t_invite "\textbf{A. Election winner}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_chal_a deb_attend_chal_a_w1 deb_attend_chal_a_w2 using "Table A20.tex", ///
	nonumber append refcat(1.t_invite "\textbf{B. Share of actual challengers}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_nonchal_a deb_attend_nonchal_a_w1 deb_attend_nonchal_a_w2 using "Table A20.tex", ///
	append nonumber refcat(1.t_invite "\specialcell{\textbf{C. Share of actual other candidates} }", nolabel) b(3) se label alignment(S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)

*** Debate rebroadcasting ***
esttab rb_confirm rb_confirm_w1 rb_confirm_w2 using "Table A22.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Radio monitors} }", nolabel) b(3) se label alignment(S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") noobs sfmt(3 %9.0fc  0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab rb_survey rb_survey_w1 rb_survey_w2 using "Table A22.tex", ///
	append nonumber refcat(1.t_invite "\specialcell{\textbf{B. Radio survey} }", nolabel) b(3) se label alignment(S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight" ) noobs sfmt(3 %9.0fc  0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
	
*** Effects on candidate debate participation (with control coefficients) ***
local numbers " & \multicolumn{2}{c}{(1)} & \multicolumn{2}{c}{(2)} & \multicolumn{2}{c}{(3)} \\ \midrule"
esttab deb_attend_share deb_attend_share_w1 deb_attend_share_w2 using "Table A26.tex", ///
	replace wide nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Share of candidates}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite ED_*)
esttab deb_attend_incumbent deb_attend_incumbent_w1 deb_attend_incumbent_w2 using "Table A26.tex", ///
	nonumber wide append refcat(1.t_invite "\textbf{B. Incumbent}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite ED_*)
esttab deb_attend_chal deb_attend_chal_w1 deb_attend_chal_w2 using "Table A26.tex", ///
	nonumber wide append refcat(1.t_invite "\textbf{C. Share of challengers}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite ED_*)
esttab deb_attend_nonchal deb_attend_nonchal_w1 deb_attend_nonchal_w2 using "Table A26.tex", ///
	nonumber wide append refcat(1.t_invite "\textbf{D. Share of other candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite ED_*)

*** Effects on candidate debate participation (demography-weighted) ***
local numbers " & (1) & (2) \\ \midrule"	
esttab deb_attend_share deb_attend_share_w3 using "Table A13.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Share of candidates}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_incumbent deb_attend_incumbent_w3 using "Table A13.tex", ///
	nonumber append refcat(1.t_invite "\textbf{B. Incumbent}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_chal deb_attend_chal_w3 using "Table A13.tex", ///
	nonumber append refcat(1.t_invite "\textbf{C. Share of challengers}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_nonchal deb_attend_nonchal_w3 using "Table A13.tex", ///
	nonumber append refcat(1.t_invite "\textbf{D. Share of other candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
	
*** Effects on candidate debate participation (district-level) ***
esttab deb_attend_share_2 deb_attend_share_2_w1 using "Table A21.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Share of candidates}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_incumbent_2 deb_attend_incumbent_2_w1 using "Table A21.tex", ///
	nonumber append refcat(1.t_invite "\textbf{B. Incumbent}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_chal_2 deb_attend_chal_2_w1 using "Table A21.tex", ///
	nonumber append refcat(1.t_invite "\textbf{C. Share of challengers}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations"  "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab deb_attend_nonchal_2 deb_attend_nonchal_2_w1 using "Table A21.tex", ///
	nonumber append refcat(1.t_invite "\textbf{D. Share of other candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") noobs sfmt(3 %9.0fc 0) compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
	

*** Cross-sectional specification **********************************************
********************************************************************************
	
estimates drop _all	

foreach var in std_d_knowledge std_d_knowledge_w1 std_d_knowledge_w2 std_d_knowledge_w3 /// 
d_heard d_heard_N d_winner_attend d_share_participants d_share_top3 ///
d_discuss_friends d_discuss_coordinate i_other_sources {
	eststo `var': cap qui reghdfe `var' 1.t_invite $ctrls, absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "No"
		quietly qui sum `var' if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_1: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_obs], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"
		quietly qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'	
	eststo `var'_2: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_reg], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		quietly qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_3: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_dem], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Dem"
		quietly qui sum `var' [aw=wgt_dem] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
}

*** Panel specification ********************************************************
********************************************************************************

global ctrls "c.r_survey_day c.r_male c.r_age c.r_ed_* c.ED_* 1.rb_treat_bl##1.t_invite"

// Main
foreach var in std_p_knowledge std_p_knowledge_w1 std_p_knowledge_w2 std_p_knowledge_w3 ///
std_d_exposure std_d_exposure_w1 std_d_exposure_w2 std_d_exposure_w3 /// 
std_i_demand std_i_demand_w1 std_i_demand_w2 std_i_demand_w3 ///
d_heard_d i_CDF_correct_d i_CDF_rep_law_d i_CDF_cit_law_d i_radio_d i_friends_d {
	eststo `var': cap qui reghdfe `var' 1.t_invite $ctrls, absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "No"	
		quietly qui sum `var' if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'	
	eststo `var'_1: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_obs], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"	
		quietly qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_2: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_reg], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		quietly qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_3: cap qui reghdfe `var' 1.t_invite $ctrls [aw=wgt_dem], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Dem"
		quietly qui sum `var' [aw=wgt_dem] if e(sample)==1 & t_invite==0
		qui estadd scalar Control_Mean = `r(mean)'
}

*** Effects on debate exposure and information acquisition ***
local numbers " & (1) & (2) & (3) \\ \midrule"
esttab std_d_exposure std_d_exposure_w1_1 std_d_exposure_w2_2 using "Table 8.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Debate listening index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_d_knowledge std_d_knowledge_w1_1 std_d_knowledge_w2_2 using "Table 8.tex", ///
	nonumber append refcat(1.t_invite "\specialcell{\textbf{B. Debate knowledge index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_p_knowledge std_p_knowledge_w1_1 std_p_knowledge_w2_2 using "Table 8.tex", ///
	nonumber append refcat(1.t_invite "\textbf{C. Policy knowledge index}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_i_demand std_i_demand_w1_1 std_i_demand_w2_2 using "Table 8.tex", ///
	append nonumber refcat(1.t_invite "\specialcell{\textbf{D. Political information acquisition}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)

*** Effects on debate exposure and information acquisition (with control coefficients) ***
local numbers " & \multicolumn{2}{c}{(1)} & \multicolumn{2}{c}{(2)} & \multicolumn{2}{c}{(3)} \\ \midrule"
esttab std_d_exposure std_d_exposure_w1_1 std_d_exposure_w2_2 using "Table A31.tex", ///
	replace wide nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Debate listening index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep($keep_vars)
esttab std_d_knowledge std_d_knowledge_w1_1 std_d_knowledge_w2_2 using "Table A31.tex", ///
	nonumber wide append refcat(1.t_invite "\specialcell{\textbf{B. Debate knowledge index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep($keep_vars)	
esttab std_p_knowledge std_p_knowledge_w1_1 std_p_knowledge_w2_2 using "Table A32.tex", ///
	nonumber posthead("`numbers'") wide replace refcat(1.t_invite "\textbf{C. Policy knowledge index}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep($keep_vars)
esttab std_i_demand std_i_demand_w1_1 std_i_demand_w2_2 using "Table A32.tex", ///
	append wide nonumber refcat(1.t_invite "\specialcell{\textbf{D. Political information acquisition}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep($keep_vars)
	
*** Effects on debate exposure and information acquisition (demography-weighted) ***
local numbers " & (1) & (2) \\ \midrule"
esttab std_d_exposure std_d_exposure_w2_3 using "Table A15.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\specialcell{\textbf{A. Debate listening index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_d_knowledge std_d_knowledge_w2_3 using "Table A15.tex", ///
	nonumber append refcat(1.t_invite "\specialcell{\textbf{B. Debate knowledge index}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_p_knowledge std_p_knowledge_w2_3 using "Table A15.tex", ///
	nonumber append refcat(1.t_invite "\textbf{C. Policy knowledge index}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab std_i_demand std_i_demand_w2_3 using "Table A15.tex", ///
	append nonumber refcat(1.t_invite "\specialcell{\textbf{D. Political information acquisition}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight  \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)

*** Effects on debate exposure and information acquisition (disaggregated) ***
local numbers " & (1) & (2) & (3) \\ \midrule"
local index "\multicolumn{4}{c}{\textbf{A. Debate listening index}} \\ \midrule" 
esttab d_heard_d d_heard_d_1 d_heard_d_2 using "Table A18.tex", ///
	nonumber replace posthead("`numbers'" "`index'") refcat(1.t_invite "\specialcell{\textbf{(1) Change in heard debate}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab d_heard d_heard_1 d_heard_2 using "Table A18.tex", ///
	nonumber append refcat(1.t_invite "\textbf{(2) Heard debate}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab d_heard_N d_heard_N_1 d_heard_N_2 using "Table A18.tex", ///
	nonumber append refcat(1.t_invite "\textbf{(3) Number of times heard}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
local index "\midrule \multicolumn{4}{c}{\textbf{B. Debate knowledge index}} \\ \midrule" 
esttab d_winner_attend d_winner_attend_1 d_winner_attend_2 using "Table A18.tex", ///
	append nonumber posthead("`index'") refcat(1.t_invite "\textbf{(1) Debate winner attended debate}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab d_share_participants d_share_participants_1 d_share_participants_2 using "Table A18.tex", ///
	append nonumber refcat(1.t_invite "\textbf{(2) Stated share of participating candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab d_share_top3 d_share_top3_1 d_share_top3_2 using "Table A18.tex", ///
	append nonumber refcat(1.t_invite "\textbf{(3) Stated share of participating leading candidates}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
local index "\midrule \multicolumn{4}{c}{\textbf{C. Policy knowledge index}} \\ \midrule" 	
esttab i_CDF_correct_d i_CDF_correct_d_1 i_CDF_correct_d_2 using "Table A18.tex", ///
	append nonumber posthead("`index'") refcat(1.t_invite "\textbf{(1) Manager of CSDF}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab i_CDF_rep_law_d i_CDF_rep_law_d_1 i_CDF_rep_law_d_2 using "Table A18.tex", ///
	append nonumber refcat(1.t_invite "\textbf{(2) CSDF reporting requirement}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab i_CDF_cit_law_d i_CDF_cit_law_d_1 i_CDF_cit_law_d_2 using "Table A18.tex", ///
	append nonumber refcat(1.t_invite "\textbf{(3) CSDF citizen involvement requirement}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") sfmt(3 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
local index "\midrule \multicolumn{4}{c}{\textbf{D. Political information demand index}} \\ \midrule" 
esttab i_radio_d i_radio_d_1 i_radio_d_2 using "Table A18.tex", ///
	nonumber append posthead("`index'") refcat(1.t_invite "\specialcell{\textbf{(1) Change in radio listening}}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab i_other_sources i_other_sources_1 i_other_sources_2 using "Table A18.tex", ///
	nonumber append refcat(1.t_invite "\textbf{(2) Demand for non-radio information sources}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab i_friends_d i_friends_d_1 i_friends_d_2 using "Table A18.tex", ///
	nonumber append refcat(1.t_invite "\textbf{(3) Change in political discussion with friends}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)

*** Effects on coordination and political engagement ***
esttab d_discuss_friends d_discuss_friends_1 d_discuss_friends_2 using "Table A25.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_invite "\textbf{(1) Discussed debate with friends}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)
esttab d_discuss_coordinate d_discuss_coordinate_1 d_discuss_coordinate_2 using "Table A25.tex", ///
	append nonumber refcat(1.t_invite "\textbf{(2) Discussion led to coordination}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("Control_Mean \hspace{0.1cm} Control Mean" "N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") sfmt(3 %9.0fc 0) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_invite)	

*** Effects of rebroadcasting intervention *************************************
********************************************************************************

global ctrls "c.r_survey_day c.r_male c.r_age c.r_ed_* c.ED_* 1.rb_treat_bl##1.t_broadcast"

foreach var in std_d_exposure_b std_d_exposure_b_w1 std_d_exposure_b_w2 {
	* Unrestricted sample *
	eststo `var': cap qui reghdfe `var' i.t_broadcast $ctrls, absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "No"	
		qui sum `var' if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'	
	eststo `var'_1: capture qui reghdfe `var' i.t_broadcast $ctrls [aw=wgt_obs] , absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"	
		qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo `var'_2: cap qui reghdfe `var' i.t_broadcast $ctrls [aw=wgt_reg], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'
	* Restricting to Intensive Invite districts *
	eststo i_`var': cap qui reghdfe `var' i.t_broadcast $ctrls if t_invite==1, absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "No"	
		qui sum `var' if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'	
	eststo i_`var'_1: cap qui reghdfe `var' i.t_broadcast $ctrls if t_invite==1 [aw=wgt_obs] , absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "1/Obs"	
		qui sum `var' [aw=wgt_obs] if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'
	eststo i_`var'_2: cap qui reghdfe `var' i.t_broadcast $ctrls if t_invite==1 [aw=wgt_reg], absorb( $FE ) cluster(EDCODE)
		qui estadd local Weight "Reg/Obs"
		qui sum `var' [aw=wgt_reg] if e(sample)==1 & t_broadcast==0
		qui estadd scalar Control_Mean = `r(mean)'
}

local numbers " & (1) & (2) & (3) \\ \midrule"
esttab std_d_exposure_b std_d_exposure_b_w1_1 std_d_exposure_b_w2_2 using "Table A24.tex", ///
	replace nonumber posthead("`numbers'") refcat(1.t_broadcast "\textbf{A. Full sample}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_broadcast)
esttab i_std_d_exposure_b i_std_d_exposure_b_w1_1 i_std_d_exposure_b_w2_2 using "Table A24.tex", ///
	append nonumber refcat(1.t_broadcast "\textbf{B. Respondents in \textit{Intensive Invite} districts}", nolabel) b(3) se label alignment(S S S) f nomtitles nogaps booktabs scalars("N \hspace{0.1cm} Observations" "Weight \hspace{0.1cm} Weight") sfmt(%9.0fc) noobs compress star(* 0.10 ** 0.05 *** 0.01) nobaselevels keep(1.t_broadcast)

